package cn.sx.stream.receiver.consumer;

import cn.sx.stream.common.pojo.MyEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class StreamTestConsumer {

    //定义一个消费方法 监听目标进行消费
    @StreamListener("stream-receiver-input01")
    public void consume01(MyEvent msg){
        log.info("当前消费者01,拿到消息数据:{}",msg);
    }
    @StreamListener("stream-receiver-input02")
    public void consume02(MyEvent msg){
        log.info("当前消费者02,拿到消息数据:{}",msg);
    }
}
